import { encoded, translations } from "./data.js";

console.log("Let's rock");

function decoded(encoded, translations) {
  const id = [];
  for (let i = 0; i < encoded.length; i++) {
    const obj = encoded[i];
    id.push(obj.groupId);
    for (let key in obj) {
      if (
        key.endsWith("Id") &&
        key !== "service" &&
        key !== "formatSize" &&
        key !== "ca" &&
        obj[key] in translations
      ) {
        let trans = translations[obj[key]];
        obj[key] = trans;
      }
    }
  }
  return [encoded, id];
}

console.log(decoded(encoded, translations));
